/* SPDX-License-Identifier: GPL-2.0+
 *
 * Copyright (c) 2016-2018, LomboTech Co.Ltd. All rights reserved.
 * Author: lomboswer <lomboswer@lombotech.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef __CSP_PDM_H
#define __CSP_PDM_H

/* enable pdm block */
void csp_pdm_enable(void *regs);

/* disable pdm block */
void csp_pdm_disable(void *regs);

/* enable hpf */
void csp_pdm_hpf_enable(void *regs);

/* disable hpf */
void csp_pdm_hpf_disable(void *regs);

/* open pdm rx channel */
void csp_pdm_rx_open(void *regs);

/* close pdm rx channel */
void csp_pdm_rx_close(void *regs);

/* set sample bitwidth */
void csp_pdm_set_wlen(void *regs, u32 wlen);

/* set pdm clk divider */
void csp_pdm_set_div(void *regs, u32 div);

/* set pdm osr */
void csp_pdm_set_osr(void *regs, u32 osr);

/* set pdm fs */
void csp_pdm_set_fs(void *regs, u32 fs);

/* set channel cnt */
void csp_pdm_set_channel(void *regs, u32 channel);

/* set data enable */
void csp_pdm_set_dat_enable(void *regs, u32 index);

/* SDIN dma addr */
u32 csp_pdm_dmaaddr_in(void);

u32 csp_pdm_readl(void *regs);

u32 csp_pdm_readr(void *regs);

void csp_pdm_writel(void *regs, u32 val);

void csp_pdm_writer(void *regs, u32 val);


#endif /* __CSP_PDM_H */

